<template>
  <a-card :bordered="false">

    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">

          <a-col :md="6" :sm="12">
            <a-form-item label="交易哈希码">
              <a-input placeholder="请输入交易哈希码" v-model="queryParam.transactionHash"></a-input>
            </a-form-item>
          </a-col>


         <a-col :md="6" :sm="8">
            <a-form-item label="企业用户ID">
              <a-input placeholder="请输入企业用户ID" v-model="queryParam.userId"></a-input>
            </a-form-item>
          </a-col>

         <a-col :md="6" :sm="8">
          <a-form-item label="上链状态">
              <j-dict-select-tag v-model="queryParam.status" placeholder="请选择上链状态查询" dictCode="onChain_status"/>
            </a-form-item>
        </a-col>

         
          <a-col :md="6" :sm="8">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <!-- <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a> -->
            </span>
          </a-col>

        </a-row>
      </a-form>
    </div>

    <!-- 操作按钮区域 -->
    <div class="table-operator" style="border-top: 5px">
      <a-button type="primary" icon="download" @click="handleExportXls('上链信息记录列表')">导出</a-button>
    </div>

    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        bordered
        size="middle"
        rowKey="id"
        style="word-break:break-all"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">
      </a-table>
    </div>

  </a-card>
</template>


<script>
  import {putAction} from '@/api/manage';
  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  import JInput from '@/components/jeecg/JInput'
  import JDictSelectTag from '@/components/dict/JDictSelectTag'
  
  export default {
    name: "EthTransactionList",
    mixins:[JeecgListMixin],
    components: {
      JInput,
      JDictSelectTag
    },
    data() {
      return {
        description: '这是上链版本列表',
        queryParam: {},
        columns: [
        //  {
        //     title: '#',
        //     dataIndex: '',
        //     key:'rowIndex',
        //     width:60,
        //     align:"center",
        //       return parseInt(index)+1;
        //     }
        //   }, 
          {
            title: '交易哈希码',
            align: "left",
            width: 120,
            dataIndex: 'transactionHash',
          },
          {
            title: '上链状态',
            align: "center",
            width: 60,
            dataIndex: 'status_dictText',
          },
          {
            title: '上链用户ID',
            align: "center",
            width: 100,
            dataIndex: 'userId',
          },
          {
            title: '上链企业ID',
            align: "center",
            width: 100,
            dataIndex: 'comsumsId',
          },





         {
            title: '上链信息',
            align: "left",
            width: 180,
            dataIndex: 'data',
          },
         {
            title: '创建时间',
            align: "center",
            width: 80,
            dataIndex: 'createTime',
          },
          
          {
            title: '成功上链时间',
            align: "center",
            width: 80,
            dataIndex: 'successTime',
          },

        ],
        url: {
          list: "/ethTransaction/list",
          exportXlsUrl: "/ethTransaction/exportXls",
        },
      }
    },

  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>